'use strict';

// Controllers para modais
angular.module('simon.controllers').controller('errorDialogCtrl', ['$scope','$modalInstance', 'header', 'msg',
  function ($scope, $modalInstance, header, msg) {
	$scope.header = (angular.isDefined(header)) ? header : 'Error';
	$scope.msg = (angular.isDefined(msg)) ? msg : 'An unknown error has occurred.';
  	$scope.close = function() {
  		$modalInstance.close();
  		$scope.$destroy();
     	};
  }]);


angular.module('simon.controllers').controller('notifyDialogCtrl', ['$scope','$modalInstance', 'header', 'msg',
  function ($scope, $modalInstance, header, msg) {
	$scope.header = (angular.isDefined(header)) ? header : 'Error';
	$scope.msg = (angular.isDefined(msg)) ? msg : 'An unknown error has occurred.';
	$scope.close = function() {
		$modalInstance.close();
		$scope.$destroy();
   	};
  }]);

angular.module('simon.controllers').controller('confirmDialogCtrl', ['$scope','$modalInstance',
  function ($scope, $modalInstance) {
	$scope.no = function() {
		$modalInstance.dismiss('no');
	};
	
	$scope.yes = function() {
		$modalInstance.close('yes');
	};
  }]);
